runOnStartup(async runtime => {

    Button2_Button2ShowTextInButton.ButtonStringShow()
    cc_Game.addEventListener("Button2Tick", (e) => {
    })
    cc_Game.addEventListener("Button2Init", (e) => {

    })
});
cc_Game.Button2_Button2ShowTextInButton = {
    ButtonStringShow: function () {
        var buttonClass = runtime.objects.Button
        buttonClass.addEventListener("instancecreate", (e) => {
            /**
             * @type {ISpriteInstance}
             */
            let getButton = e.instance
            //console.log(getButton)
            var buttonText = runtime.objects.ButtonInText
            var textInstance = buttonText?.createInstance(getButton.layer.name, getButton.x, getButton.y, true)
            var tString = "null"
            if (Game_GameStringBranch.Languge == "cn") {
                tString = getButton?.instVars.cn_text
            }
            if (Game_GameStringBranch.Languge == "en") {
                tString = getButton?.instVars.en_text
            }

            textInstance.text = tString
            textInstance.zElevation = 1
            getButton.addChild(textInstance, {
                transformX: true,
                transformY: true,
                transformWidth: false,
                transformHeight: false,
                transformAngle: true,
                transformZElevation: true,
                destroyWithParent: true
            })
            //console.log(textInstance)
        })
    }
}
export default Button2_Button2ShowTextInButton